//
//  HomeViewController.swift
//  Wallpaper
//
//  Created by    on 2023/12/19.
//

import UIKit

class HomeViewController: BaseViewController {
    lazy var menuBtn : UIButton = {
        let btn : UIButton = UIButton(type: .custom)
        btn.setImage(UIImage(named: "nav_icon"), for: .normal)
        btn.addTarget(self, action: #selector(showSlipView), for: .touchUpInside)
        return btn
    }()
    lazy var rightBtn : UIButton = {
        let btn : UIButton = UIButton(type: .custom)
        btn.setImage(UIImage(named: "Vector"), for: .normal)
        btn.addTarget(self, action: #selector(pushNotificationVC), for: .touchUpInside)
        return btn
    }()
    @objc func showSlipView() {
        SideSlipView.show()
    }
    
    @objc func pushNotificationVC() {
        self.navigationController?.pushViewController(FilterViewController(), animated: true)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationItem.titleView = CustomTitleView()
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: menuBtn)
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: rightBtn)
        let titleAttributes: [NSAttributedString.Key: Any] = [
            .foregroundColor: UIColor.white
        ]
        self.navigationController?.navigationBar.titleTextAttributes = titleAttributes
    }
}
